//
//  UIFont+Addtion.m
//  ChangeFont
//
//  Created by huangjian on 2019/10/17.
//  Copyright © 2019 huangjian. All rights reserved.
//

#import "UIFont+Addtion.h"

@implementation UIFont (Addtion)

+ (UIFont *)dy_font:(CGFloat)fontSize {
    fontSize = [self resetFont:fontSize];
    return [UIFont systemFontOfSize:fontSize];
}

+ (UIFont *)dy_blodFont:(CGFloat)fontSize {
    fontSize = [self resetFont:fontSize];
    return [UIFont boldSystemFontOfSize:fontSize];
}

//MARK: - 根据本地存储字体获取新的字体
+(NSInteger)resetFont:(CGFloat)fontSize{
     NSString *currentFont = [[NSUserDefaults standardUserDefaults] objectForKey:@"kLocalTextFont"];
     CGFloat newfontSize = fontSize * (0.1*(currentFont.intValue - 2)+1);
    return newfontSize;
}

@end
